package com.alibaba.alink.operator.stream.dataproc.vector;

import org.apache.flink.ml.api.misc.param.Params;

import com.alibaba.alink.common.annotation.NameCn;
import com.alibaba.alink.common.annotation.NameEn;
import com.alibaba.alink.common.annotation.ParamSelectColumnSpec;
import com.alibaba.alink.common.annotation.TypeCollections;
import com.alibaba.alink.operator.common.dataproc.vector.VectorAssemblerMapper;
import com.alibaba.alink.operator.stream.utils.MapStreamOp;
import com.alibaba.alink.params.dataproc.vector.VectorAssemblerParams;

/**
 * VectorAssembler is a transformer that combines a given list of columns(vector or numerical column) into a single
 * vector column. It is useful for combining features generated by different feature transformers into a
 * single feature vector, in order to train ML models like logistic regression and decision trees. VectorAssembler
 * accepts the following input column types: all numeric types, and vector type. In each row, the values
 * of the input columns will be concatenated into a vector in the specified order.
 *
 * this operator cam transform stream data.
 */
@ParamSelectColumnSpec(name = "selectedCols", portIndices = 0, allowedTypeCollections = TypeCollections.VECTOR_TYPES)
@NameCn("向量聚合")
@NameEn("Vector assembler")
public final class VectorAssemblerStreamOp extends MapStreamOp <VectorAssemblerStreamOp>
	implements VectorAssemblerParams <VectorAssemblerStreamOp> {

	private static final long serialVersionUID = -5155135801401252657L;

	public VectorAssemblerStreamOp(Params params) {
		super(VectorAssemblerMapper::new, params);
	}

	public VectorAssemblerStreamOp() {
		this(null);
	}
}
